package com.k7.mobile.platform.dao.impl;

import java.util.List;

import com.k7.mobile.platform.dao.IGramDAO;
import com.k7.mobile.platform.dataobject.GramDO;
import com.k7.mobile.platform.dataobject.RankingDO;
import com.k7.mobile.platform.dataobject.RecommendxDO;


public class GramDAOImpl extends BaseDAOImpl implements IGramDAO{

	@Override
	public Long add(GramDO gramDO) {
		
		Object id = getSqlMapClientTemplate().insert("GRAM-ADD", gramDO);
		return (Long) id;
	}
	
	@Override
	public void delete(GramDO gramDO) {
		
		this.getSqlMapClientTemplate().delete("GRAM-DEL", gramDO);
		
	}

	@Override
	public void update(GramDO gramDO) {
		
		this.getSqlMapClientTemplate().update("GRAM-UPDATE", gramDO);
		
	}

	@Override
	public List<GramDO> findList(GramDO gramDO) {
		
		return this.executeQueryForList("FIND-GRAM-LIST","FIND-GRAM-LIST-COUNT",  gramDO);
	}

	@Override
	public GramDO getGram(GramDO gramDO) {
		return (GramDO) this.getSqlMapClientTemplate().queryForObject("GET-GRAM", gramDO);
	}
	@Override
	public List<GramDO> findRankingGameList(RankingDO rankingDO) {
		return this.executeQueryForList("FIND-RANKING-GAME-LIST","FIND-RANKING-GAME-LIST-COUNT",  rankingDO);
	}
	@Override
	public List<GramDO> findRecommendGameList(RecommendxDO recommendxDO) {
		return this.executeQueryForList("FIND-RECOMMEND-GAME-LIST","FIND-RECOMMEND-GAME-LIST-COUNT",  recommendxDO);
	}


}
